import moment from 'moment';
export const chat_time = time => {
	return moment(time).format('MM-DD HH:mm');
}

export const transfromtTime = time => {
	var d = new Date(moment(time).format());
	var times = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + (d.getHours()<10?'0'+d.getHours():d.getHours()) + ':' + (d.getMinutes()<10?'0'+d.getMinutes():d.getMinutes()) +
		':' + (d.getSeconds()<10?'0'+d.getSeconds():d.getSeconds());
	return times
}



// let start_date = moment().subtract(1, 'weeks')
// let end_date = moment()

// end_date.diff(start_date) // 返回毫秒数

// end_date.diff(start_date, 'months') // 0
// end_date.diff(start_date, 'weeks') // 1
// end_date.diff(start_date, 'days') // 7
// start_date.diff(end_date, 'days') // -7
